import { createApp } from 'vue'
import App from './App.vue'
import './mock/index.js'
import mitt from 'mitt'

const Mitt = mitt()
const app = createApp(App)

declare module 'vue' {
    export interface ComponentCustomProperties {
        $Bus : typeof Mitt
    }
}

app.config.globalProperties.$Bus = Mitt


type Filter = {
    format: <T>(str:T) => string
}


declare module '@vue/runtime-core' {
    export interface ComponentCustomProperties {
        filter:Filter,
        dev : string
    }
}

app.config.globalProperties.filter = {
    format<T>(str:T) : string {
        return `${str}`
    }
}

app.config.globalProperties.dev = '张三'

app.mount('#app')
